import { defineNuxtConfig } from "nuxt3";

// https://v3.nuxtjs.org/docs/directory-structure/nuxt.config
export default defineNuxtConfig({
  // mode: "universal",
  // srcDir: "src/",
  srcDir: "src/main/webapp",

  css: [
    "element-plus/dist/index.css",
    "normalize.css",
    "@/assets/css/index.scss",
    "@/theme/index.scss",
  ],

  meta: {
    title: "天织平台",
    meta: [
      { charset: "utf-8" },
      {
        name: "viewport",
        content: "width=device-width, initial-scale=1, user-scalable=0",
      },
      {
        hid: "keywords",
        name: "keywords",
        content: "keywords",
      },
      {
        hid: "description",
        name: "description",
        content: "description",
      },
    ],
    link: [{ rel: "icon", type: "image/x-icon", href: "/favicon.ico" }],
    script: [],
  },
  //跳转404页面
  router: {
    extendRoutes(routes: any) {
      routes.push({
        path: "*",
        redirect: "/404",
      });
    },
  },
  build: {},
  // plugins: [
  //   "~/plugins/i18n.js", //添加至插件
  // ],

  // plugins: ["@/plugins/i18n.js"],

  // plugins: [
  //   // { src: "~plugins/injectPlugins.js" },
  //   // { src: "~plugins/main" },
  //   { src: "~/plugins/i18n.js" },
  //   // { src: "~/components/autoImportCommonComponents.js" },
  // ],
});
